// 路由层

module.exports = app => {

    const controller = require(path.resolve(basename, 'controller/controller.js'));
    app.get('/', controller.index);
    app.post('/register', controller.register);
    app.post('/login', controller.login);
    app.post('/emailcode', controller.emailcode);
    app.post('/addproduct', upload.single('file'), controller.addproduct);
    app.post('/updateproduct', upload.single('file'), controller.updateproduct);
    app.post('/deleteproduct', controller.deleteproduct);
    app.post('/searchproduct', controller.searchproduct);
    app.post('/searchOrder', controller.searchOrder);
    app.get('/product',controller.product);
    app.get('/order',controller.order);
}